<template>
  <div class="longPic">
    <div class="longPicList" v-for="(temp,index) in miva" :key="index" @click="checked(temp)">
      <!-- <div class="longPicImg">
        <img src="http://placehold.it/225x673" alt="">
      </div> -->
      <el-image class="longPicImg" :src="temp.poster |  cover" fit="cover"></el-image>
    </div>
    <div class="layer" v-show="show" @click="show = false">
      <longLayer></longLayer>
    </div>
  </div>
</template>

<script>
import longLayer from "@/components/longLayer";
export default {
  filters: {
    cover(posters) {
      console.log(posters);
      if (!posters) return "http://placehold.it/640x1280";
      return posters.split(",")[0];
    }
  },
  components: { longLayer },
  props: {
    miva: {
      type: [String, Array],
      default: ""
    }
  },
  created() {
    console.log(this.miva);
  },
  data() {
    return {
      show: false
    };
  },
  methods: {
    checked(value) {
      // this.show = true;
      // this.nowCheck = value;
      console.log(value);
      this.$store.commit("SETTING_MASK", { type: "longPic", data: value });
    }
  }
};
</script>

<style lang="less">
.longPic {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  box-sizing: border-box;
  padding: 20px 0 0;
  .longPicList {
    position: relative;
    width: 225px;
    height: 673px;
    margin-right: 20px;
    overflow: hidden;
    // margin: 20px 0;
    background: #fff;
    box-shadow: 0px 2px 25px 0px rgba(189, 189, 189, 0.3);
    .longPicImg {
      width: 100%;
      background: #dadada;
    }
    .info::before {
      content: "";
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 0.5em;
      background: linear-gradient(
          135deg,
          transparent,
          transparent 45%,
          #dadada,
          transparent 55%,
          transparent 100%
        ),
        linear-gradient(
          45deg,
          transparent,
          transparent 45%,
          #dadada,
          transparent 55%,
          transparent 100%
        );
      background-size: 0.8em 0.8em;
      background-repeat: repeat-x, repeat-x;
    }
  }
}
</style>
